import path from 'path'
import UnoCSS from 'unocss/vite'
import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'

export default defineConfig({
    base: './',
    plugins: [
        vue(),
        UnoCSS({
            configFile: path.join(process.cwd(), 'uno.config.mjs')
        })
    ],
    resolve: {
        alias: {
            '@': path.resolve(__dirname, 'src')
        }
    },
    server: {
        port: 7000,
        host: '127.0.0.1'
    },
    build: {
        minify: true,
        target: 'esnext',
        emptyOutDir: true,
        rollupOptions: {
            output: {
                chunkFileNames: 'js/[name]-[hash].js',
                entryFileNames: 'js/[name]-[hash].js',
                assetFileNames: '[ext]/[name]-[hash].[ext]'
            }
        }
    }
})
